<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>历史报销数据</title>
        <link rel="stylesheet" href="css/common.css"/>
        <link rel="stylesheet" href="css/main.css"/>
        <link rel="stylesheet" href="css/jquery-ui-timepicker-addon.css"/>
        <link rel="stylesheet" href="css/jquery-ui.css"/>
        <link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
        <link href="css/city-picker.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="css/jquery-impromptu.min.css" type="text/css"/>
        <link rel="stylesheet" href="css/iconfont.css" type="text/css"/>
        <link rel="stylesheet" href="css/combo.select.css" type="text/css"/>
    </head>

<body>
<div id="dataLoad" style="display:none; position: fixed; width: 100%; top: 20%; z-index: 1001;">
       <table width=100% height=100% border=0 align=center valign=middle>
        <tr height=50%><td align=center>&nbsp;</td></tr>
        <tr><td align=center><img src="images/loading.gif"/></td></tr>
        <tr><td align=center id="load_msg">提交中，请稍后......</td></tr>
        <tr height=50%><td align=center>&nbsp;</td></tr>
       </table>
     </div>
    <div class="container">
    <div id="search_bar" class="mt10">
        <div class="box">
            <div class="box_border">
                <div class="box_top">
                    <b class="pl15">基本报销信息</b>
                    <input type="button" value="出差审批信息" id="travel_app_info" class="ext_btn ext_btn_success" >
                </div>
                <div class="box_center pt10 pb10" style="margin-left: 10%">
                    <table class="form_table" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>报销人姓名</td>
                            <td><input type="text" name="name" class="input-text lh25" size="25" disabled id="apply_name"></td>
                            <td>所属部门</td>
                            <td><input type="text" name="name" class="input-text lh25" size="25" disabled id="apply_section_name"></td>
                            <td>职别</td>
                            <td><input type="text" name="name" class="input-text lh25" size="10" disabled id="execu_level"></td>
                            <td>性别</td>
                            <td>
                                <span class="fl">
                                  <div class="select_border">
                                      <div class="select_containers ">
                                          <select name="" class="select" id="apply_sex" disabled>
                                              <option value="0">男</option>
                                              <option value="1">女</option>
                                          </select>
                                      </div>
                                  </div>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td>出差类别</td>
                            <td><input type="text" name="name" class="input-text lh25" size="25" disabled id="business_type"></td>
                            <td>大案要案号</td>
                            <td><input type="text" name="name" class="input-text lh25" size="25" disabled id="case_no"></td>
                            <td>预批天数</td>
                            <td><input type="text" name="name" class="input-text lh25" size="10" disabled id="pre_apply_days"></td>

                        </tr>
                        <tr>
                            <td>公务卡号</td>
                            <td><input type="text" name="name" class="input-text lh25" size="25" disabled id="apply_card_num" value="6227 0036 6000 0046 690"></td>
                            <td>工资号</td>
                            <td><input type="text" name="name" class="input-text lh25" size="25" disabled id="apply_salary_num"></td>
                            <td>预借差旅</td>
                            <td><input type="text" name="name" class="input-text lh25" size="10" disabled id="pre_loan_money"></td>
                            <td>自驾车</td>
                            <td>
                                <span class="fl">
                                  <div class="select_border">
                                      <div class="select_containers ">
                                          <select name="" class="select" id="self_drive" disabled>
                                              <option value="0">否</option>
                                              <option value="1">是</option>
                                          </select>
                                      </div>
                                  </div>
                                </span>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div id="table" class="mt10">
        <div class="box_top">
            <b class="pl15">报销数据表</b>
            <input type="button" value="历史报销" id="history_info" class="ext_btn ext_btn_success" >
        </div>
        <div class="box span10 oh">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table" id="info_fee_table">
                <tr>
                    <th class="td_center" style="width:3%">序号</th>
                    <th class="td_center" style="width:10%">开始日期</th>
                    <th class="td_center" style="width:12%">出发地</th>
                    <th class="td_center" style="width:10%">结束日期</th>
                    <th class="td_center" style="width:12%">目的地</th>
                    <th class="td_center" style="width:5%">车费</th>
                    <th class="td_center" style="width:5%">船费</th>
                    <th class="td_center" style="width:5%">机票</th>
                    <th class="td_center" style="width:6%">天(路/停)</th>
                    <th class="td_center" style="width:6%">住宿费用</th>
                    <th class="td_center" style="width:6%">伙食补助</th>
                    <th class="td_center" style="width:5%">公杂费</th>
                    <th class="td_center" style="width:5%">其它</th>
                    <th class="td_center" style="width:10%">操作</th>
                </tr>
                <tr class="fee_row">
                    <td class='td_right' colspan="11">公务卡费用合计：</td>
                    <td class='td_center' colspan="2"><span id="total_official_fee">0</span></td>
                    <td class='td_center'><a href='' class='ext_btn' id="off_info_btn"><span class='browse'></span>详情</a></td>
                </tr>
                <tr class="fuhe_row" style="display:none;background-color:#F5DEB3">
                    <td class='td_right' colspan="11">复核公务卡费用：</td>
                    <td class='td_center' colspan="2"><span id="fuhe_official_fee">0</span></td>
                    <td class='td_center'></td>
                </tr>
                <tr class="fee_row">
                    <td class='td_right' colspan="11">报销费用合计：</td>
                    <td class='td_center' colspan="2"><span id="total_table_fee">0</span></td>
                    <td></td>
                </tr>
                <tr class="fuhe_row" style="display:none;background-color:#F5DEB3">
                    <td class='td_right' colspan="11">复核报销费用合计：</td>
                    <td class='td_center' colspan="2"><span id="fuhe_total_fee">0</span></td>
                    <td></td>
                </tr>
                <!--<tr class="fee_row">-->
                    <!--<td class='td_right' colspan="11">嫌疑人费用：</td>-->
                    <!--<td class='td_center' colspan="2"><span id="suspect_fee">0</span></td>-->
                    <!--<td></td>-->
                <!--</tr>-->
                <!--<tr class="fee_row">-->
                    <!--<td class='td_right' colspan="11">网上追逃奖励费用：</td>-->
                    <!--<td class='td_center' colspan="2"><span id="reward_fee">0</span></td>-->
                    <!--<td></td>-->
                <!--</tr>-->
            </table>
        </div>
    </div>
        <div class="box_bottom pb5 pt5 pr10 append_info" style="border:1px solid #dadada;">
            <div class="search_bar_btn" style="text-align:left;" id="append_info">
                <span>嫌疑人费用报销单：<input type="button" name="button" class="btn1 btn82 btn_search" id="suspect_fee_btn" value="查看"></span>
                <span>超标费用报销单：<input type="button" name="button" class="btn1 btn82 btn_search" id="over_standard_btn" value="查看"></span>
                <span>未使用公务卡报销审批单：<input type="button" name="button" class="btn1 btn82 btn_search" id="un_official_app_btn" value="查看"></span>
                <span>自驾车里程附件：<input type="button" name="button" class="btn1 btn82 btn_search" id="self_drive_btn" value="查看"></span>
            </div>
        </div>
        <div class="box_bottom pb5 pt5 pr10 modify_area" style="border:1px solid #dadada; display:none">
            <div class="search_bar_btn" style="text-align:right;">
                <input type="button" name="button" class="btn1 btn82 btn_add" id="modify_btn" value="修改">
            </div>
        </div>
        <div class="box_bottom pb5 pt5 pr10 approve_area" style="border:1px solid #dadada; display:none">
            <div class="search_bar_btn" style="text-align:right;">
                <input type="button" id="approve_btn" name="button" class="btn1 btn82 btn_config" value="审批">
            </div>
        </div>
        <div class="box_bottom pb5 pt5 pr10 calc_area" style="border:1px solid #dadada;display:none">
            <div class="search_bar_btn" style="text-align:right;">
                <input type="button" id="fuhe_refuse" name="button" class="btn1 btn82 btn_del" value="驳回">
                <input type="button" id="check_btn" name="button" class="btn1 btn82 btn_count" value="核算">
            </div>
        </div>

        <div class="main_center span10" id="opinion_area">
            <div class="box_top">
                <b class="pl15">报销审批信息：</b>
                <select name="" class="select" style="border: 1px solid #003eff;background-color: #ffffff" id="approve_info">

                </select>
            </div>
            <div class="span33 fl pt10">
                <div class="box pr5">
                    <div class="box_border" style="height: 230px">
                        <div class="box_top">
                            <b>部门审批意见</b>
                            <input class="ext_btn ext_btn_submit app_detail" type="submit" value="详情">
                        </div>
                        <div class="box_center opinion" id="section_opinion"><h1>同意出差</h1></div>
                        <div class="box_center sign"><h3>签批人：<img id="section_sign"  width="100px" height="50px"></h3></div>
                    </div>
                </div>
            </div>
            <div class="span33 fl pt10">
                <div class="box pl5 pr5">
                    <div class="box_border" style="height: 230px">
                        <div class="box_top">
                            <b>分管领导意见</b>
                            <input class="ext_btn ext_btn_submit app_detail" type="submit" value="详情">
                        </div>
                        <div class="box_center opinion" id="section_leader_opinion"><h1>同意出差</h1></div>
                        <div class="box_center sign"><h3>签批人：<img id="section_leader_sign"  width="100px" height="50px"></h3></div>
                    </div>
                </div>
            </div>
            <div class="span33 fl pt10">
                <div class="box pl5">
                    <div class="box_border" style="height: 230px">
                        <div class="box_top">
                            <b>局领导意见</b>
                            <input class="ext_btn ext_btn_submit app_detail" type="submit" value="详情">
                        </div>
                        <div class="box_center opinion" id="leader_opinion"><h1>同意出差</h1></div>
                        <div class="box_center sign"><h3>签批人：<img id="leader_sign"  width="100px" height="50px"></h3></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div id="app_dialog" class="mt10" style="display:none" title="审批窗口">
        <div class="box">
            <div class="box_center">
                <table class="form_table pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="td_left">审批意见：
                    <span class="">
                        <div class="select_border">
                            <div class="select_containers ">
                                <select id="app_opinion" class="select">
                                    <option value="1">同意</option>
                                    <option value="0">驳回</option>
                                </select>
                            </div>
                        </div>
                    </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_left">详细意见：</td>
                    </tr>
                    <tr>
                        <td class="">
                            <textarea name="" id="app_opinion_detail" cols="20" rows="30" placeholder="请填写具体审批意见" class="textarea">同意报销</textarea>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div id="suspect_fee_dlg" class="mt10" style="display: none">
        <div class="box">
            <div class="box_border">
                <div class="box_center"></div>
                <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="td_right" valign="top">嫌疑人姓名：</td>
                        <td class="">
                            <textarea name="" id="suspect_name" placeholder="请输入嫌疑人姓名，多人请用逗号分隔" cols="30" rows="10" class="textarea" disabled></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_right">嫌疑人总费用：</td>
                        <td height="40px" style="line-height:40px">
                            <input type="number" name="pre_suspect_fee" class="input-text lh25" id="pre_suspect_fee" size="20" disabled>
                            <span></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_right">生活费：</td>
                        <td>
                            <input type="number" placeholder="嫌疑人生活费" name="suspect_life_fee" value="0" class="input-text lh25" id="suspect_life_fee" size="20" disabled>
                            <span></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_right">交通费：</td>
                        <td>
                            <input type="number" placeholder="嫌疑人交通费" name="suspect_road_fee" value="0" class="input-text lh25" id="suspect_road_fee" size="20" disabled>
                            <span></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_right">其它费用：</td>
                        <td>
                            <input type="number" placeholder="嫌疑人其它费用" name="suspect_other_fee" value="0" class="input-text lh25" id="suspect_other_fee" size="20" disabled>
                            <span></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_right">是否均有票：</td>
                        <td class="">
                            <input type="radio" name="hasReceipe" value="1" disabled> 是
                            <input type="radio" name="hasReceipe" value="0" checked disabled> 否
                        </td>
                    </tr>
                    <tr id="non_rece_area">
                        <td class="td_right" valign="top">无票理由：</td>
                        <td class="">
                            <textarea name="" id="non_rece_reason" placeholder="请描述无票理由" cols="35" rows="20" class="textarea" disabled></textarea>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div id="overstandard_app" class="mt10" style="display:none" title="超标交通费用审批单">
        <div class="box">
            <div class="box_center">
                <table class="form_table pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="td_left">所属部门：</td>
                        <td class="">
                            <input type="text" placeholder="请输入所属部门" class="input-text lh25" size="20" id="over_depart" disabled>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_left">申报人：</td>
                        <td class="">
                            <input type="text" placeholder="请输入人员姓名" class="input-text lh25" size="20" id="over_user" disabled>
                        </td>
                    </tr>
                    <tr>
                        <td class="td_left">超标原因：</td>
                        <td class="">
                            <textarea name="" id="over_reason" cols="30" rows="10" class="textarea" disabled></textarea>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div id="img_dialog" title="自驾里程预览">
        <div id="sliders" style="display:none;width:800px;height:600px">
            <a href="#" class="slidesjs-previous slidesjs-navigation"><i class="ui-icon ui-icon-triangle-1-w"></i></a>
            <a href="#" class="slidesjs-next slidesjs-navigation"><i class="ui-icon ui-icon-triangle-1-e"></i></a>
        </div>
    </div>
    <div id="app_type_dialog" class="mt10" style="display:none" title="选择审批类型">
        <div class="box">
            <div class="box_center">
                <table class="form_table pb15" id="approval_type_table" width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="td_left">报销单审批</td>
                        <td>
                            <span class="pl5">
                                <input type="button" id="app_fee_btn" name="button" class="btn1 btn82 btn_config" value="审批">
                            </span>
                            <span class="ui-state-error-text"><i class='ui-icon ui-icon-circle-close'></i>未审批</span>
                        </td>
                    </tr>
                    <tr style="display:none">
                        <td class="td_left">嫌疑人费用审批</td>
                        <td>
                            <span class="pl5">
                                <input type="button" id="app_suspect_btn" name="button" class="btn1 btn82 btn_config" value="审批">
                            </span>
                            <span class="ui-state-error-text"><i class='ui-icon ui-icon-circle-close'></i>未审批</span>
                        </td>
                    </tr>
                    <tr style="display:none">
                        <td class="td_left">超标审批</td>
                        <td>
                            <span class="pl5">
                                <input type="button" id="app_overstandard_btn" name="button" class="btn1 btn82 btn_config" value="审批">
                            </span>
                            <span class="ui-state-error-text"><i class='ui-icon ui-icon-circle-close'></i>未审批</span>
                        </td>
                    </tr>
                    <tr style="display:none">
                        <td class="td_left">未使用公务卡报销审批</td>
                        <td>
                            <span class="pl5">
                                <input type="button" id="app_unofficial_btn" name="button" class="btn1 btn82 btn_config" value="审批">
                            </span>
                            <span class="ui-state-error-text"><i class='ui-icon ui-icon-circle-close'></i>未审批</span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div id="check_dlg" class="mt10" style="display:none" title="单项报销核销窗口">
        <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr class="fee self_drive_fee">
                <td class="td_right">油费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入油费,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee self_drive_fee">
                <td class="td_right">过路费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入过路费,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee self_drive_fee">
                <td class="td_right">里程数：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入里程数,无请填0" name="hotel_fee" value="0" class="input-text lh25 input_fee" id="hotel_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预填里程：</td>
                <td height="30px" style="line-height:30px">
                    <input  name="transport_fee" value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee non_self_drive" >
                <td class="td_right">车费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入车费,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee non_self_drive">
                <td class="td_right">船费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入船费,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee non_self_drive">
                <td class="td_right">机票费用：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入机票费用,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee" style="border-top: 2px solid #e9e9e9">
                <td class="td_right">住宿费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入住宿费,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee">
                <td class="td_right">伙食补助：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入伙食费补助,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee">
                <td class="td_right">公杂费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入公杂费补助,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee" style="border-top: 2px solid #e9e9e9">
                <td class="td_right">嫌疑人费用：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入嫌疑人报销费用,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input name="transport_fee" value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee">
                <td class="td_right">网上追逃金：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入网上追逃金费用,无请填0"  value="0" class="input-text lh25 input_fee"  size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  name="transport_fee" value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee self_drive_fee">
                <td class="td_right">车辆维护费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入车辆维护费用,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input name="transport_fee" value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
            <tr class="fee">
                <td class="td_right">其它费用：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入其它报销费用,无请填0" value="0" class="input-text lh25 input_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预报费用：</td>
                <td height="30px" style="line-height:30px">
                    <input  name="transport_fee" value="0" class="input-text lh25 pre_fee" size="10" disabled>
                </td>
            </tr>
        </table>
    </div>
    <div id="official_fee_dlg" class="mt10" style="display:none" title="公务卡报销信息">
        <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="td_right">住宿费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" placeholder="请输入住宿费,无请填0" name="official_hotel_fee" value="0"
                       class="input-text lh25" id="official_hotel_fee" size="10" disabled>
                <span></span>
            </td>
            <td class="td_right">应报费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" id="max_official_hotel_fee" value="0"
                       class="input-text lh25" size="10" disabled>
            </td>
        </tr>
        <tr>
            <td class="td_right">机票费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" placeholder="请输入机票费用,无请填0" name="official_plane_fee" disabled
                       value="0" class="input-text lh25" id="official_plane_fee" size="10">
                <span></span>
            </td>
            <td class="td_right">应报费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" id="max_official_plane_fee" value="0"
                       class="input-text lh25" size="10" disabled>
            </td>
        </tr>
        <tr>
            <td class="td_right">油费费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" placeholder="请输入油费,无请填0" name="official_oil_fee" disabled
                       value="0" class="input-text lh25" id="official_oil_fee" size="10">
                <span></span>
            </td>
            <td class="td_right">应报费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" id="max_official_oil_fee" value="0"
                       class="input-text lh25" size="10" disabled>
            </td>
        </tr>
        <tr>
            <td class="td_right">车辆维护费：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" placeholder="请输入车辆维护费,无请填0" name="official_car_maintain_fee" disabled
                       value="0" class="input-text lh25" id="official_car_maintain_fee" size="10">
                <span></span>
            </td>
            <td class="td_right">应报费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" id="max_official_car_maintain_fee" value="0"
                       class="input-text lh25" size="10" disabled>
            </td>
        </tr>
        <tr>
            <td class="td_right">实报总费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" placeholder="自动计算公务卡报销金额" name="official_total_fee"
                       value="0" class="input-text lh25" id="official_total_fee" size="10" disabled>
                <span></span>
            </td>
            <td class="td_right">应报总费用：</td>
            <td height="30px" style="line-height:30px">
                <input type="number" id="max_official_total_fee" value="0"
                       class="input-text lh25" size="10" disabled>
            </td>
        </tr>
    </table>
    </div>
    <div id="official_unuse_app_dlg" class="mt10" style="display:none" title="未使用公务卡报销审批单">
    <div class="box">
        <div class="box_center">
            <table class="form_table pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="td_left">所属部门：</td>
                    <td class="">
                        <input type="text" placeholder="请输入所属部门" class="input-text lh25" size="20" id="unuse_off_section" disabled>
                    </td>
                </tr>
                <tr>
                    <td class="td_left">申报人：</td>
                    <td class="">
                        <input type="text" placeholder="请输入人员姓名" class="input-text lh25" size="20" id="unuse_off_user" disabled>
                    </td>
                </tr>
                <tr>
                    <td class="td_left">应报公务卡金额：</td>
                    <td class="">
                        <input type="text" class="input-text lh25" size="20" id="need_off_fee" disabled>
                    </td>
                </tr>
                <tr>
                    <td class="td_left">实报公务卡金额：</td>
                    <td class="">
                        <input type="text" class="input-text lh25" size="20" id="act_off_fee" disabled>
                    </td>
                </tr>
                <tr>
                    <td class="td_left">说明原因：</td>
                    <td class="">
                        <textarea name="" id="unuse_off_reason" cols="30" rows="10" class="textarea" disabled></textarea>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
    <div id="final_check_dlg" class="mt10" style="display:none" title="最终核销确认窗口">
        <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr class="fee" style="border-top: 2px solid #e9e9e9">
                <td class="td_right">总复核报销费用：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" name="other_fee" value="0" class="input-text lh25" id="f_c_check_total_fee" disabled size="10">
                    <span></span>
                </td>
                <td class="td_right">预报销总费用：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" name="other_fee" value="0" class="input-text lh25" id="f_c_pre_total_fee" disabled size="10">
                    <span></span>
                </td>
            </tr>

            <tr class="fee" style="border-top: 2px solid #e9e9e9">
                <td class="td_right">借款核销：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入核销借款费用,无请填0" name="other_fee" value="0" class="input-text lh25" id="f_c_loan_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">预借费用：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" name="" value="0" class="input-text lh25" size="10" id="f_c_loan_pre_fee" disabled>
                </td>
            </tr>

            <tr class="fee" style="border-top: 2px solid #e9e9e9">
                <td class="td_right">公务卡报销：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入公务卡核销费用,无请填0" value="0" class="input-text lh25" id="f_c_check_official_fee" size="10">
                    <span></span>
                </td>
                <td class="td_right">公务卡核销：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" name="" value="0" class="input-text lh25" size="10" id="f_c_official_pre_fee" disabled>
                </td>
            </tr>
            <tr class="fee" style="border-top: 2px solid #e9e9e9">
                <td class="section_area td_right">报销部门：</td>
                <td class="section_area">
                    <span class="fl">
                        <div class="select_border">
                            <div class="select_containers ">
                                <select name="" class="select" id="section_type">

                                </select>
                            </div>
                        </div>
                    </span>
                </td>
            </tr>
            <tr class="fee">
                <td class="section_area td_right">部门承担经费：</td>
                <td height="30px" style="line-height:30px">
                    <input type="number" placeholder="请输入部门承担经费，无填0" value="0" class="input-text lh25" id="section_fee" size="20">
                    <span></span>
                </td>
            </tr>



        </table>
    </div>

</body>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/config.js"></script>
<script type="text/javascript" src="js/jquery-impromptu.min.js"></script>
<script type="text/javascript" src="js/FeeAppendApprove.js"></script>
<script type="text/javascript" src="js/fuheItem.js"></script>
<script type="text/javascript" src="js/approveFee.js"></script>
<script type="text/javascript" src="js/jquery.slides.js" charset="gbk"></script>
<script src="js/jquery.combo.select.js" type="text/javascript"></script>
<script>
    var needApprove = 1;
    var approveOpinion = {'approve_suspect':0, 'approve_overstandard':0};
    var self_drive = 0;

    //核销数据存放
    var fuhe_data = {data:[]};

    //全局变量，用于存放当前复核状态
    var approve_state = -1;

    //全局变量，用于存放当前数据
    var curItem = {};



    //辅助函数，处理公务卡报销信息显示
    function initOfficialCardInfo(){
        var official_fee_data = curItem.fee_data.official_fee_info;
        $('#official_hotel_fee').val(official_fee_data.official_hotel_fee);
        $('#official_oil_fee').val(official_fee_data.official_oil_fee);
        $('#official_car_maintain_fee').val(official_fee_data.official_car_maintain_fee);
        $('#official_plane_fee').val(official_fee_data.official_plane_fee);
        $('#official_total_fee').val(official_fee_data.official_fee);
        $('#max_official_hotel_fee').val(official_fee_data.max_official_hotel_fee);
        $('#max_official_oil_fee').val(official_fee_data.max_official_oil_fee);
        $('#max_official_car_maintain_fee').val(official_fee_data.max_official_car_maintain_fee);
        $('#max_official_plane_fee').val(official_fee_data.max_official_plane_fee);
        $('#max_official_total_fee').val(official_fee_data.max_official_fee);
    }

    //辅助函数，处理公务卡信息显示的按钮
    function showOfficialInfo(){
        $('#off_info_btn').click(function(e){
            e.preventDefault();
            $('#official_fee_dlg').dialog({
                resizable: false,
                height: "auto",
                width: "auto",
                modal: true,
                buttons:{
                    '确定': function(){
                        $(this).dialog('close');
                    }
                }
            })

        });
    }


    //辅助函数，创建基本用户信息
    //辅助函数，初始化报销表头用户和基本信息
    function initBasicApplyInfo(){
        $('#apply_name').val(curItem.travel_app_data.approval_user_name);
        $('#apply_section_name').val(curItem.travel_app_data.section_name);
        $('#business_type').val(getBusinessTypeInfo(curItem.travel_app_data.type));
        $('#case_no').val(curItem.travel_app_data.case_name == "" ? '否' : curItem.travel_app_data.case_name);
        $('#pre_apply_days').val(curItem.travel_app_data.days);
        $('#apply_card_num').val(curItem.travel_app_data.approval_user_card);
        $('#apply_salary_num').val(curItem.travel_app_data.approval_userID);
        $('#self_drive').val(curItem.travel_app_data.self_drive);
        self_drive = curItem.travel_app_data.self_drive;
        $('#pre_loan_money').val(curItem.travel_app_data.is_loan_money == '0' ? 0 : curItem.travel_app_data.loan_money.money);
        $('#execu_level').val(getExecuInfo(curItem.travel_app_data.executive_level));

        //复核用的数据
        var user = JSON.parse(window.localStorage.getItem('user_info'));
        fuhe_data.user_id = user.user_id;
        fuhe_data.travel_fee_id = curItem.fee_data.travel_fee_id;
        fuhe_data.travel_app_id = curItem.travel_app_data.approval_ID;


    }

    //辅助函数，用于详情信息的查看
    function processFeeItemLook(){
        $('.fee_look').click(function(e){
            e.preventDefault();
            var id = $(this).parent().parent().find('td').eq(0).html();

            if($(this).hasClass('fee_item')){
                showFeeItemDetail(id-1);
            }
        })
    }

    //辅助函数，用于显示报销信息条目详情
    function showFeeItemDetail(id){
        initFuheItemDlg(curItem.fee_data_item[id], curItem.fee_data_item[id], true);
        var title = "条目" + (id + 1) + '报销信息';
        $('#check_dlg').dialog({
            resizable: false,
            height: "auto",
            width: "auto",
            modal: true,
            title: title,
            buttons:{
                '确定': function(){
                        $(this).dialog('close');
                }
            }
        })
    }

    //辅助函数，用于处理表格显示
    function initTableInfo(){
        var opStr = "";
        if(approve_state == '4'){
            opStr = "<a href='' class='ext_btn fee_confirm fee_item'><span class='modify'></span>核销</a>";
        }
        else{
            opStr = "<a href='' class='ext_btn fee_look fee_item'><span class='browse'></span>详情</a>"
        }

        initTableHeader(curItem.travel_app_data.self_drive);
        var total_car_fee = 0.0;
        var total_boat_fee = 0.0;
        var total_flight_fee = 0.0;
        var total_stay_days = 0.0;
        var total_road_days = 0.0;
        var total_hotel_fee = 0;
        var total_food_fee = 0;
        var total_inci_fee = 0;
        var total_other_fee = 0;
        var total_distance = 0;
        var total_oil_fee = 0;
        var total_pass_fee = 0;
        for(var i = 0; i < curItem.fee_data_item.length; i++){
            total_car_fee += parseFloat(curItem.fee_data_item[i].car_fee);
            total_boat_fee += parseFloat(curItem.fee_data_item[i].boat_fee);
            total_flight_fee += parseFloat(curItem.fee_data_item[i].flight_fee);
            total_stay_days += parseInt(curItem.fee_data_item[i].stay_days);
            total_road_days += parseInt(curItem.fee_data_item[i].road_days);
            total_hotel_fee += parseFloat(curItem.fee_data_item[i].hotel_fee);
            total_food_fee += parseFloat(curItem.fee_data_item[i].food_fee);
            total_inci_fee += parseFloat(curItem.fee_data_item[i].inci_fee);
            total_other_fee += parseFloat(curItem.fee_data_item[i].other_fee)
                + parseFloat(curItem.fee_data_item[i].suspect_fee)
                + parseFloat(curItem.fee_data_item[i].reward_fee)
                + parseFloat(curItem.fee_data_item[i].car_main_fee);
            total_distance += parseFloat(curItem.fee_data_item[i].distance);
            total_pass_fee += parseFloat(curItem.fee_data_item[i].pass_fee);
            total_oil_fee += parseFloat(curItem.fee_data_item[i].oil_fee);

            $('.fee_row').first().before(
                    "<tr class='apply_row'>" +
                        "<td class='td_center'>" + (i+1) +"</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].start_time + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].start_dest + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].end_time + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].end_dest + "</td>" +
                        "<td class='td_center'>" + (self_drive == 0 ? curItem.fee_data_item[i].car_fee : curItem.fee_data_item[i].oil_fee) + "</td>" +
                        "<td class='td_center'>" + (self_drive == 0 ? curItem.fee_data_item[i].boat_fee : curItem.fee_data_item[i].pass_fee) +"</td>" +
                        "<td class='td_center'>" + (self_drive == 0 ? curItem.fee_data_item[i].flight_fee : curItem.fee_data_item[i].distance) + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].road_days + "/" + curItem.fee_data_item[i].stay_days + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].hotel_fee + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].food_fee + "</td>" +
                        "<td class='td_center'>" + curItem.fee_data_item[i].inci_fee + "</td>" +
                        "<td class='td_center'>" + (parseFloat(curItem.fee_data_item[i].other_fee)
                                                  + parseFloat(curItem.fee_data_item[i].suspect_fee)
                                                  + parseFloat(curItem.fee_data_item[i].reward_fee)
                                                  + parseFloat(curItem.fee_data_item[i].car_main_fee)) + "</td>" +
                        "<td class='td_center'>" + opStr + "</td>" +
                    "</tr>");
        }
        $('.fee_row').first().before(
            "<tr class='apply_row'>" +
                "<td class='td_right' colspan='5'>"+ '小计：' + "</td>" +
                "<td class='td_center'>" + (self_drive == 0 ? total_car_fee.toFixed(2) : total_oil_fee.toFixed(2)) + "</td>" +
                "<td class='td_center'>" + (self_drive == 0 ? total_boat_fee.toFixed(2) : total_pass_fee.toFixed(2)) +"</td>" +
                "<td class='td_center'>" + (self_drive == 0 ? total_flight_fee.toFixed(2) : total_distance.toFixed(2)) + "</td>" +
                "<td class='td_center'>" + parseInt(total_road_days) + "/" + parseInt(total_stay_days)+"</td>" +
                "<td class='td_center'>" + total_hotel_fee.toFixed(2) + "</td>" +
                "<td class='td_center'>" + total_food_fee.toFixed(2) + "</td>" +
                "<td class='td_center'>" + total_inci_fee.toFixed(2) + "</td>" +
                "<td class='td_center'>" + total_other_fee.toFixed(2) + "</td>" +
                "<td class='td_center'></td>" +
            "</tr>");

        $('#total_official_fee').text(curItem.fee_data.official_fee_info.official_fee);
        $('#total_table_fee').text(curItem.fee_data.pre_total_fee);
        $('#suspect_fee').text(curItem.fee_data.suspect_fee);
        $('#reward_fee').text(curItem.fee_data.reward_fee);

    }

    //辅助函数，初始化未使用公务卡报销审批单信息对话框
    function initUnUseOfficialFeeDlg(){
        $('#unuse_off_user').val(curItem.travel_app_data.approval_user_name);
        $('#unuse_off_section').val(curItem.travel_app_data.section_name);
        $('#need_off_fee').val(curItem.fee_data.official_fee_info.max_official_fee);
        $('#act_off_fee').val(curItem.fee_data.official_fee_info.official_fee);
        //console.log(JSON.stringify(curItem));
        $('#unuse_off_reason').val(curItem.fee_data.unOfficial.reason);
    }

    //辅助函数，初始化超标审批
    function initOverloadFeeDlg(){
        $('#over_depart').val(curItem.travel_app_data.section_name);
        $('#over_user').val(curItem.travel_app_data.approval_user_name);
        $('#over_reason').val(curItem.fee_data.overStandard.over_reason);
    }

    //辅助函数，初始化嫌疑人费用显示
    function initSuspectFeeDlg(){
        $('#suspect_name').val(curItem.fee_data.suspect_fee_data.suspect_name);
        $('#pre_suspect_fee').val(curItem.fee_data.suspect_fee);
        $('#suspect_life_fee').val(curItem.fee_data.suspect_fee_data.suspect_life_fee);
        $('#suspect_road_fee').val(curItem.fee_data.suspect_fee_data.suspect_road_fee);
        $('#suspect_other_fee').val(curItem.fee_data.suspect_fee_data.suspect_other_fee);
        $("input[name='hasReceipe']").each(function(){
            if($(this).val() == curItem.fee_data.suspect_fee_data.has_receipe){
                $(this).prop('checked', true);
            }
        });
        if(curItem.fee_data.suspect_fee_data.has_receipe == '1'){
            $('#non_rece_area').hide();
        }
        else{
            $('#non_rece_area').show();
            $('#non_rece_reason').text(curItem.fee_data.suspect_fee_data.no_receipe_reason);
        }
    }
    //辅助函数，处理自驾车附件查看
    function checkSelfDriveImg(img, appID){
        var imgs = img.split(';');
        var sliders= $('#sliders a').eq(0);
        var selfImgs = [];
        $('#load_msg').text('加载中，请稍后...');
        $('#dataLoad').show();
        //遍历整个图片数组
        for(var i = 0; i < imgs.length - 1; i++){
            imgs[i] = url + 'uploads/files/fee/' + appID + '/' + imgs[i];
            selfImgs[i] = new Image();
            selfImgs[i].src = imgs[i];

//            var s = function(){
//                do{
//                    if(selfImgs[i].width > 0 || selfImgs[i].height > 0){
//                        break;
//                    }
//                }while(true);
//            };
//            s();
            $(sliders).before("<image src='" + imgs[i] + "' width=800px height=800px>");
        }
            if(imgs.length <= 2){
                $(".slidesjs-previous").hide();
                $(".slidesjs-next").hide();
            }
            else{
                $(".slidesjs-previous").show();
                $(".slidesjs-next").show();
            }


        $('#dataLoad').hide();
    }

    //辅助函数，显示详细审批意见
    function ShowApproveDetail(){
        var app_info_type = $('#approve_info').val();
        var msg = {'section':'', 'section_leader':'', 'leader':''};
        switch(app_info_type){
            case 'fee':
                msg.section = curItem.fee_data.section_approve_opinion;
                msg.section_leader = curItem.fee_data.section_leader_opinion;
                msg.leader = curItem.fee_data.leader_opinion;
                break;
            case 'suspect':
                msg.section = curItem.fee_data.suspect_fee_data.section_approve_opinion;
                msg.section_leader = curItem.fee_data.suspect_fee_data.section_leader_opinion;
                msg.leader = curItem.fee_data.suspect_fee_data.leader_opinion;
                break;
            case 'overstandard':
                msg.section = curItem.fee_data.overStandard.section_approve_opinion;
                msg.section_leader = curItem.fee_data.overStandard.section_leader_opinion;
                msg.leader = curItem.fee_data.overStandard.leader_opinion;
                break;
            case 'unOfficial':
                msg.section = curItem.fee_data.unOfficial.section_approve_opinion;
                msg.section_leader = curItem.fee_data.unOfficial.section_leader_opinion;
                msg.leader = curItem.fee_data.unOfficial.leader_opinion;
                break;
        }
        $('.app_detail').each(function(){
            $(this).unbind('click');
        });
        var app_details = $('.app_detail');
        $(app_details[0]).click(function(){
            $.prompt( "<p>" + (msg.section == '' ? '未审批' : msg.section) + "</p>",{
                title: '审批详细信息',
                buttons: {'确定': true}
            });
        })
        $(app_details[1]).click(function(){
            $.prompt( "<p>" + (msg.section_leader == '' ? '未审批' : msg.section_leader) + "</p>",{
                title: '审批详细信息',
                buttons: {'确定': true}
            });
        })
        $(app_details[2]).click(function(){
            $.prompt( "<p>" + (msg.leader == '' ? '未审批' : msg.leader) + "</p>",{
                title: '审批详细信息',
                buttons: {'确定': true}
            });
        })

    }

    //辅助函数,初始化签名和意见
    function setOpinionArea(){
        var appVal = $('#approve_info').val();

        switch(appVal){
            case 'fee':
                setApproveOpinion(curItem.fee_data,4);
                break;
            case 'suspect':
                setApproveOpinion(curItem.fee_data.suspect_fee_data,4);
                break;
            case 'overstandard':
                setApproveOpinion(curItem.fee_data.overStandard, 4);
                break;
            case 'unOfficial':
                setApproveOpinion(curItem.fee_data.unOfficial, 4);
                break;
        }
    }



    //辅助函数，处理附加信息的显示,设置审批按钮
    function initAppendArea(){
        //获取数据
        $('#approve_info').append("<option value='fee'>基本费用报销</option>")

        //如果有嫌疑人费用，处理嫌疑人费用报销清单
        if(curItem.fee_data.is_suspect_fee == '0'){
            $('#append_info span').eq(0).hide();
        }
        else{
            needApprove++;
            $('#approval_type_table tr').eq(1).show();
            approveOpinion.suspect_id = curItem.fee_data.suspect_fee_data.suspect_ID;
            $('#approve_info').append("<option value='suspect'>嫌疑人费用报销</option>");
            $('#append_info span').eq(0).show();
            initSuspectFeeDlg();
            $('#suspect_fee_btn').click(function(){
                $('#suspect_fee_dlg').dialog({
                    resizable: false,
                    height: "auto",
                    width: 600,
                    modal: true,
                    buttons: {
                        '确定': function(){
                            $(this).dialog('close');
                        }
                    }
                })
            })
        }
        //如果有超标费用，处理超标费用显示
        if(curItem.fee_data.is_over_standard == '0'){
            $('#append_info span').eq(1).hide();
        }
        else{
            needApprove++;
            $('#approval_type_table tr').eq(2).show();
            approveOpinion.over_standard_id = curItem.fee_data.overStandard.over_standard_id;
            $('#approve_info').append("<option value='overstandard'>超标交通报销</option>");
            $('#append_info span').eq(1).show();
            initOverloadFeeDlg();
            $('#over_standard_btn').click(function(){
                $('#overstandard_app').dialog({
                    resizeable: false,
                    width: 'auto',
                    height: 'auto',
                    modal: true,
                    buttons:{
                        '确定': function(){
                            $(this).dialog('close');
                        }
                    }
                })
            })
        }
        //如果有非公务卡报销强制审批单，显示，否则不显示
        if(curItem.fee_data.is_need_unofficial == 0) {
            //隐藏按钮
            $('#append_info span').eq(2).hide();
        }
        else{
            //需要附加审批
            needApprove++;
            //显示审批对话框按钮
            $('#approval_type_table tr').eq(3).show();
            //保存审批ID
            approveOpinion.unuse_official_id = curItem.fee_data.unOfficial.unuse_official_id;
            //添加未使用公务卡审批条目
            $('#approve_info').append("<option value='unOfficial'>未使用公务卡报销单</option>");
            $('#append_info span').eq(2).show();
            initUnUseOfficialFeeDlg();
            $('#un_official_app_btn').click(function(){
                $('#official_unuse_app_dlg').dialog({
                    resizeable: false,
                    width: 'auto',
                    height: 'auto',
                    modal: true,
                    buttons:{
                        '确定': function(){
                            $(this).dialog('close');
                        }
                    }
                })
            })


        }

        //如果是自驾，处理自驾按钮显示
        if(curItem.travel_app_data.self_drive == 1){
            $('#append_info span').eq(3).show();
            checkSelfDriveImg(curItem.fee_data.self_drive_img, curItem.fee_data.travel_fee_id);
            $('#self_drive_btn').click(function(){
                $("#sliders").slidesjs({
                    width: 800,
                    height: 650,
                    container: 'img_dialog',
                    generateNextPrev: true,
                    pagination: false,
                    navigation:false
                });
                $('#img_dialog').dialog({
                    resizable: false,
                    width: 'auto',
                    height: 'auto',
                    modal: true,
                    buttons: {
                        '确定': function(){
                            $(this).dialog('close');
                        }
                    }
                })

            })
        }
        else{
            $('#append_info span').eq(3).hide();
        }

        //如果有历史单据，则显示历史按钮
        if(curItem.fee_history_id != ''){
            $('#history_info').show();
            $('#history_info').click(function(){
                getHistoryFeeInfo();
            })
        }
        else{
            $('#history_info').hide();
        }
    }

    //辅助函数，用于获取历史数据
    function getHistoryFeeInfo(){
        $('#dataLoad').show();
        $.post(url + 'BusinessFee/GetBusinessFeeDetail.php', {'appID' : curItem.fee_history_id}, function(data){
            $('#dataLoad').hide();
            var t = JSON.parse(data);
            if(t.state == 1) {
                //   window.localStorage.setItem('curItem', data);
                window.localStorage.setItem('approve_state', 0);
                window.localStorage.setItem('is_history', 1);
                window.localStorage.setItem('historyFeeInfo', data);
                window.open('fee_info.html');
            }
            else{
                $.prompt("<h3>网络或数据库故障，请稍后再试</h3>", {
                    title: '错误提醒',
                    buttons: {'确定': true}
                });
            }
        })
    }



    //辅助函数，设置审批状态
    function setApproveState(history){
        if(approve_state == 0 || history == 1){
            $('.calc_area').hide();
            $('.approve_area').hide();
            $('.fee_confirm').hide();
            $('.fuhe_row').hide();
        }
        else if(approve_state == 4){
            $('.calc_area').show();
            $('.approve_area').hide();
            $('.fee_confirm').show();
            $('.fuhe_row').show();
        }
        else{
            $('.approve_area').show();
            $('.calc_area').hide();
            approveFeeInfo();
            $('#app_opinion').change(function(){
                if($(this).val() == 1){
                    $('#app_opinion_detail').val('同意报销');
                }
                else{
                    $('#app_opinion_detail').val('');

                }
            })
        }

    }

    //显示出差审批单报销信息
    //辅助函数，获取出差审批信息
    function showBusinessAppInfo(appID) {
        $('#dataLoad').show();
        $.post(url + 'BusinessApprove/GetBusinessApproveByID.php', {'appID': appID}, function (data) {
            $('#dataLoad').hide();
            var t = JSON.parse(data);
            if (t.state == 1) {
                window.localStorage.setItem('cur_travel_info', JSON.stringify(t.data[0]));
                window.localStorage.setItem('approve_state', 0);
                window.open('bussiness_approval_info.html');
            } else {
                $.prompt("<h3>网络或数据库故障，请稍后再试</h3>", {
                    title: '错误提醒',
                    buttons: {'确定': true}
                });
            }
        })
    }

    //财务驳回当前报销
    function financeRefuseApprove(){
        $('#dataLoad').show();
        $.post(url + 'BusinessFee/FinanceDiffuseBusinessFee.php', {'fee_id':curItem.fee_data.fee_id}, function(data){
            $('#dataLoad').hide();
            var t = JSON.parse(data);
            if(t.state == 1){
                $.prompt( "<h3>操作成功</h3>",{
                    title: '消息提醒',
                    buttons: {'确定': true},
                    submit: function(e, v, m ,f){
                        if(v)
                            jumpPage('finance_fee_approve.html');
                    }
                });
            }
            else{
                $.prompt( "<h3>网络或数据库繁忙，请稍后再试</h3>",{
                    title: '消息提醒',
                    buttons: {'确定': true}
                });
            }
        })
    }



    $(function(){
        //initCheckDlg();
        getSection();
        approve_state = window.localStorage.getItem('approve_state');
        //判断历史信息
        var history = window.localStorage.getItem('is_history');
        if(history == 1){
            //如果是非历史信息，curItem为当前信息，否则为历史信息
            curItem = JSON.parse(window.localStorage.getItem('historyFeeInfo'));
        }
        else{
            curItem = JSON.parse(window.localStorage.getItem('curFeeInfo'));
        }
        //getSection();

        initOfficialCardInfo();
        if((curItem.fee_data.state == 2) && (history == 0)){
            $('.modify_area').show();
        }
        else{
            $('.modify_area').hide();
        }
        setApproveState(history);

        initBasicApplyInfo();
        initTableInfo();
        processFeeItemLook();
        processFuhePress();
        initAppendArea();
        setOpinionArea();
        showOfficialInfo();

        processFuheItemDataInput();

        finalCheckFee();

        ShowApproveDetail();

        $('#travel_app_info').click(function(){
            showBusinessAppInfo(curItem.travel_app_data.approval_ID);
        });

        $('#approve_info').change(function(){
            setOpinionArea();
        });

        $("#modify_btn").click(function(e){
            $.prompt("<h3>修改数据需要重新输入所有数据</h3>", {
                title: '操作提醒',
                buttons: {'确定': true},
                submit: function(e, v, m ,f){
                    if(v){
                        //window.localStorage.setItem('cur_travel_info', JSON.stringify(curItem.travel_app_data));

                        window.localStorage.setItem('cur_travel_info', JSON.stringify(curItem.travel_app_data));
                        window.localStorage.setItem('history_fee_id', curItem.fee_data.travel_fee_id);
                        jumpPage('business_apply_for.html');

                        //把当前数据作为历史数据,且只是查看模式
                        window.localStorage.setItem('is_history', 1);
                        window.localStorage.setItem('historyFeeInfo', JSON.stringify(curItem));
                        window.open('fee_info.html');

                    }

                }
            });

        });

        $('#fuhe_refuse').click(function(e){
            $.prompt( "<h3>确定驳回本报销单吗？</h3>",{
                title: '消息提醒',
                buttons: {'确定': true, '取消':false},
                submit: function(e, v, m ,f){
                    if(v) {
                        //点击复核驳回按钮
                        financeRefuseApprove();
                    }
                }
            });
        });
    })

</script>
</html>